package com.ljtxxhwj.myblob.service.impl;

import com.ljtxxhwj.myblob.entity.Draft;
import com.ljtxxhwj.myblob.mapper.DraftMapper;
import com.ljtxxhwj.myblob.service.DraftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.Collections;
import java.util.Date;
import java.util.List;

@Service
public class DraftServiceImpl implements DraftService {
    @Autowired
    DraftMapper draftMapper;

    @Override
    public List<Draft> list(int userId) {
        return draftMapper.select(userId);
    }

    @Override
    public void delete(int draftId) {
        draftMapper.delete(draftId);
    }

    @Override
    public void save(Draft draft) {
        draftMapper.insert(draft);
    }

    @Override
    public Draft get(int draftId) {
       return draftMapper.selectById(draftId);
    }

    @Override
    public void update(Draft draft) {
        draftMapper.update(draft);
    }
}
